home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17807 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  54 lines

  1. Path: garfield.eps.agfa.be!lvhoof
  2. From: Ranko Orlic <rorlic@eps.agfa.be>
  3. Newsgroups: comp.os.ms-windows.programmer.tools.misc,comp.os.ms-windows.programmer.win32,comp.os.ms-windows.programmer.misc,comp.lang.c++
  4. Subject: [Q] Why doesn't this compile?
  5. Date: Wed, 17 Apr 1996 19:00:48 +0200
  6. Organization: Agfa-Gevaert NV.
  7. Message-ID: <317523C0.5042@eps.agfa.be>
  8. NNTP-Posting-Host: brussels.eps.agfa.be
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (WinNT; I)
  13.  
  14. Using MSVC 4.0 compiler I get the following:
  15.  
  16. File test.cpp: ---------------------------------
  17.  
  18. class A {
  19. public:
  20.     class L {
  21.     public:
  22.         L() {}
  23.         virtual void f() {
  24.             int dummy = 0;
  25.         }
  26.     };
  27.     A();
  28. };
  29.  
  30. class B : public A {
  31.     class L : public A::L {
  32.     public:
  33.         L() {}
  34.         virtual void f() {
  35.             A::L::f();
  36.         }
  37.     };
  38.     B();
  39. };
  40.  
  41. Compilation result: ----------------------------
  42.  
  43. test.cpp(18) : error C2352: 'A::L::f' : illegal call of 
  44. nonstatic member function
  45. Error executing cl.exe.
  46. test.obj - 1 error(s), 1 warning(s)
  47.  
  48. ------------------------------------------------
  49.  
  50. Anybody knows what's wrong with it?
  51. Thanks,
  52.  
  53. -- Ranko.
  54.